package com.deshan.websys.code.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.deshan.websys.code.mapper.PmsImMapper;
import com.deshan.websys.code.model.PmsIm;
import com.deshan.websys.code.model.UmsUser;
import com.deshan.websys.code.service.PmsImService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service

public class PmsImServiceImpl implements PmsImService {
    @Resource
    PmsImMapper pmsImMapper;
    @Override
    public List<PmsIm> getImDatas(String memberid) {
        QueryWrapper<PmsIm> queryWrapper =new QueryWrapper<>();
        if("".equals(memberid)){
          return   pmsImMapper.selectList(queryWrapper);
        }else{
            queryWrapper.eq("from_memberid", memberid);
         return    pmsImMapper.selectList(queryWrapper);
        }


    }

    @Override
    public int saveImData(PmsIm pmsIm) {
        int result= pmsImMapper.insert(pmsIm);
        return result;
    }
}
